#ifndef INFORECORD_H
#define INFORECORD_H
#include <QObject>
#include <QVariantList>
#include <QAbstractTableModel>
#include <QHash>
#include <QVariant>
#include <QObject>
using namespace std;
struct InfoDate{
    int in_id;
    QString in_state;
    QString in_bdata;
    QString in_hdata;
    QString in_name;
    QString in_info;
    QString in_value;
    QString in_beizhu;


};
class InfoRecord : public QAbstractTableModel{

    Q_OBJECT
 public:
     explicit InfoRecord(QAbstractTableModel *parent=0);
    Q_INVOKABLE void update(void);
    int rowCount(const QModelIndex & parent = QModelIndex()) const Q_DECL_OVERRIDE;
    int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
    QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
    void getData(void);
    enum Role {
     IdRole=Qt::UserRole + 1,
     StateRole,
     BdateRole,
     HdateRole,
     NameRole,
     InfoRole,
     ValueRole,
     BeizhuRole
    };
private:
    QList<InfoDate> model_data;

};





#endif // INFORECORD_H
